//
//  SomeViewViewController.m
//  BaseTools
//
//  Created by 李挺哲 on 15/12/9.
//  Copyright © 2015年 ltz. All rights reserved.
//

#import "SomeViewViewController.h"
#import "BTIntroViewController.h"
#import "BTCycleImageViewController.h"
#import "BTViewPagerViewController.h"
#import "ToReFreshTableViewController.h"
#import "CityListViewController.h"
#import "NetNewsViewController.h"
@interface SomeViewViewController ()
{
    NSMutableArray *array;
    BTIntroViewController * bTIntroViewController;
    BTCycleImageViewController * bTCycleImageViewController;
    BTViewPagerViewController *bTViewPagerViewController;
    ToReFreshTableViewController * toReFreshTableViewController;
    CityListViewController * cityListViewController;
    NetNewsViewController *netNewsViewController;
}
@end

@implementation SomeViewViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    array=[NSMutableArray array];
    [array addObject:@"新功能介绍"];
    [array addObject:@"广告轮播"];
    [array addObject:@"滚动导航"];
    [array addObject:@"城市列表"];
    [array addObject:@"上拉加载+下拉刷新"];
    [array addObject:@"仿网易新闻发评论"];
    [array addObject:@"下拉菜单"];
    
    UIStoryboard *story = [UIStoryboard  storyboardWithName:@"Main"  bundle:nil];
    
    bTIntroViewController=[story instantiateViewControllerWithIdentifier:@"BTIntroViewController"];
    bTCycleImageViewController=[story instantiateViewControllerWithIdentifier:@"BTCycleImageViewController"];
    
    bTViewPagerViewController=[story instantiateViewControllerWithIdentifier:@"BTViewPagerViewController"];
    toReFreshTableViewController=[story instantiateViewControllerWithIdentifier:@"ToReFreshTableViewController"];
    cityListViewController=[story instantiateViewControllerWithIdentifier:@"CityListViewController"];
    netNewsViewController=[[NetNewsViewController alloc] init];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    
    return 1;
    
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    
    
    return array.count;
    
}


-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    static NSString *reuseId = @"NetWorkTableViewCell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:reuseId];
    if (cell == nil) {
        cell=[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseId];
    }
    cell.textLabel.textAlignment=NSTextAlignmentCenter;
    cell.textLabel.text=array[indexPath.row];
    return cell;
    
    
    
}

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    
    switch (indexPath.row) {
        case 0:
            [self showViewController:bTIntroViewController sender:self];
            
            break;
            
        case 1:
            [self showViewController:bTCycleImageViewController sender:self];
            
            
            break;
        case 2:
            [self showViewController:bTViewPagerViewController sender:self];
            break;
        case 3:
            
            [self showViewController:cityListViewController sender:self];
            
            break;
        case 4:
            
             [self showViewController:toReFreshTableViewController sender:self];
            
            break;
            
        case 5:
            
            [self showViewController:netNewsViewController sender:self];
            
            break;
            
        default:
            
            break;
    }
    
}

@end
